Page({
  data: {
    items: [
      {value: 'WYY', name: '网易云热评'},
      {value: 'XZYS', name: '星座运势（需要输入您的星座）'},
      {value: 'CTS', name: '藏头诗生成（请输入藏字内容，2-8个字）'},
    ],
    focus: false,
    inputValue: ''
  },
  Tianapi: function () {
    this.onLoad();
  },
  onLoad: function () {
    var that = this
	wx.setNavigationBarTitle({
      title: '晚安心语',
    }) 
    wx.request({
      url: 'https://api.tianapi.com' + '/txapi/wanan/index',
      data: {
        key: "238c3f5c3195765876c29f3cc6bb4234" 
      },
      success: function (res) {
        if(res.data.code == 200){
        that.setData({
          content: res.data.newslist[0].content
        })
      }
      },
      fail: function (err) {
        console.log(err)
      }
    })
  },
  bindKeyInput:function (e) {
    this.setData({
      inputValue: e.detail.value
    })
  }
})
